﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using Sector7.Medical.Enums;

namespace Sector7.Medical.Controls
{
    /// <summary>
    /// DrugItemHeaderControl.xaml 的交互逻辑
    /// </summary>
    public partial class DrugItemHeaderControl : UserControl
    {
        #region Accessor
        public static readonly DependencyProperty TemplateTypeProperty =
            DependencyProperty.Register("TemplateType", typeof(DrugTemplateType), typeof(DrugItemHeaderControl), new PropertyMetadata(DrugTemplateType.PurchasesBill));

        [Description("获取或设置模板类型")]
        [Category("其他")]
        public DrugTemplateType TemplateType
        {
            get { return (DrugTemplateType)this.GetValue(TemplateTypeProperty); }
            set { this.SetValue(TemplateTypeProperty, value); }
        }
        #endregion

        #region Public functions
        #endregion

        #region Private functions
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            this.MaxHeight = 24;

            stpMain.Children.Clear();
            switch (TemplateType)
            {
                case DrugTemplateType.PurchasesBill:
                    stpMain.Children.Add(grdPurchasesBill);
                    break;
                case DrugTemplateType.AdjustRecord:
                    stpMain.Children.Add(grdAdjustRecord);
                    break;
                default:
                    break;
            }
        }
        #endregion

        #region Structure
        public DrugItemHeaderControl()
        {
            InitializeComponent();
        }
        #endregion

        #region Inner members
        #endregion
    }
}
